<?php
/**
 * common repository file Created by PhpStorm.
 * User: wumengmeng
 * Date: 2019/08/20
 * Time: 06:07
 */

namespace HiCommon\Repository;

use HiCommon\Model\EquitiesExtends;

class EquitiesExtendsRepository extends BaseRepository
{
    public function base_model(){
        return new \HiCommon\Model\EquitiesExtends();
    }


    /**
     *  根据条件获取全部数据
     *  hinq 2019 08 23
     *
     */
    public function get_all( array $arr_option = [] )
    {
        return EquitiesExtends::commonget($arr_option);
    }



    /**
     *  根据条件统计数量
     *  hinq 2019 08 23
     *
     */
    public function get_where_count( array $arrWhere = [])
    {
        return EquitiesExtends::where($arrWhere)->count();
    }

    /**
     * 添加一条数据
     *
     * @param array $arr_input
     *
     * @return mixed
     * @author wumengmeng <wu_mengmeng@foxmail.com>
     */
    public function add_one( array $arr_input)
    {   
        return EquitiesExtends::create($arr_input);
    }


    /**
     *  删除指定的数据
     *  hinq 2019 08 23
     *
     **/
    public function delete_one( int $nId ){
        return EquitiesExtends::where('id', $nId)->commondelete();
    }


    /**
     *  编辑一条数据
     *  hinq 2019 08 27
     *
     **/
    public function edit_one( array $arr_input ){
        return EquitiesExtends::where('id', $arr_input['id'])->update($arr_input);
    }
	
}